package com.ruibang.glass.sale.controller;


import com.ruibang.glass.sale.domain.req.GSaleBackHouseOrderReq;
import com.ruibang.glass.sale.service.GSaleBackHouseOrderService;
import com.ruibang.glass.sale.service.GSaleReturnExchangeOrderService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author mameng
 */
@Api(tags = "退货入库单")
@RestController
@RequestMapping("/api/glass/sale/back/house/order")
public class GSaleBackHouseOrderController {
    @Autowired
    private GSaleBackHouseOrderService gSaleBackHouseOrderService;

    @Autowired
    private GSaleReturnExchangeOrderService gSaleReturnExchangeOrderService;

    @PostMapping("list")
    @ApiOperation(value = "订单管理列表", response = ResultBody.class)
    public ResultBody list(@RequestBody GSaleBackHouseOrderReq gSaleBackHouseOrderReq) {
        return ResultBody.success(gSaleBackHouseOrderService.getPage(gSaleBackHouseOrderReq));
    }


    @GetMapping("getOne/{id}")
    @ApiOperation(value = "获取对象", response = ResultBody.class)
    public ResultBody addOrUpdate(@PathVariable("id") String id) {
        return ResultBody.success(gSaleReturnExchangeOrderService.getGSaleReturnExchangeOrderOne(id));
    }

}
